﻿<?php
	
//登录用户验证及权限
include_once("./dag_functions/class_core_utf-8.php");

//通过session 将搜索关键字传递到服务端
session_start();
$keyword="";
$keyword=$_POST["keyword"]; 

if ($_SESSION["usertype"]==null)
{
	
	$login_user_type=$_POST["login_user_type"]; 
	$login_user_id=$_POST["TxtUserName"]; 
	$login_user_dep="xlb";	//用户单位
		switch ($login_user_type){
			case "user":$login_user="普通用户";break;
			case "dep_admin":$login_user="单位保密员";break;
			case "dag_admin":$login_user="档案管理员";break;
			case "sys_admin":$login_user="系统管理员";break;			
		}
	//此处登录验证
	
	if ($login_user_id == null)
	{
		 ?>
					<script language="javascript" type="text/javascript">
		           alert("请登录！");
		           window.location.href="login.htm"; 
					</script>	
	<?php
	}
	else
	{
		$_SESSION["usertype"] = $login_user;
		$_SESSION["userID"] = $login_user_id;
		$_SESSION["userDEP"] = "xlb";
	}
}
//输出全局变量，为js调用
echo ("ddbug:"."jyqq_user_dep:<input name=\"jyqq_user_dep\" type=\"text\" id=\"jyqq_user_dep\" value=".$_SESSION["userDEP"]." />");
echo ("this_user_type:<input name=\"this_user_type\" type=\"text\" id=\"this_user_type\" value=".$_SESSION["usertype"]." /> ");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" -->

<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>::DAG::</title>
<meta http-equiv="Content-Language" content="en-us" /> 
<meta name="keywords" content="dhtml grid, AJAX grid, event, trigger " >
<meta name="description" content="How to add event to grid" >

<script src="highlight/jssc3.js" type="text/javascript"></script>
<link href="highlight/style.css" rel="stylesheet" type="text/css" />

<style type="text/css" media="all">@import "./css/doc_no_left.css";</style>


<link rel="stylesheet" type="text/css" media="all" href="./grid/calendar/calendar-blue.css"  />
<script type="text/javascript" src="./grid/calendar/calendar.js"></script>
<script type="text/javascript" src="./grid/calendar/calendar-cn-utf8.js"></script>
<script type="text/javascript" src="./grid/calendar/calendar-setup.js"></script>

<link rel="stylesheet" type="text/css" href="./grid/gt_grid.css" />
<link rel="stylesheet" type="text/css" href="./grid/skin/vista/skinstyle.css" />
<script type="text/javascript" src="./grid/gt_msg_en.js"></script>
<script type="text/javascript" src="./grid/gt_grid_all.js"></script>
<script type="text/javascript" src="./grid/flashchart/fusioncharts/FusionCharts.js"></script>
<script type="text/javascript" src="./dag_functions/Calendar.js"></script>
<script type="text/javascript" >
	
var THIS_FILE_QX="";	//当前档案权限 
var THIS_FILE_ID="";	//当前档案ID
//判断某个id是否存在
function exist(id){
    var s=document.getElementById(id);
    if(s){return true}
    else{return false}
   }

//获取地址栏参数
function UrlSearch() 
{
   var name,value; 
   var str=location.href; //取得整个地址栏
   var num=str.indexOf("?") 
   str=str.substr(num+1); //取得所有参数
   var arr=str.split("&"); //各个参数放到数组里
   for(var i=0;i < arr.length;i++){ 
    num=arr[i].indexOf("="); 
    if(num>0){ 
     name=arr[i].substring(0,num);
     value=arr[i].substr(num+1);
     this[name]=value;
     } 
    } 
   
}
 
//var Request=new UrlSearch(); 	//实例化
//var keyword;
//keyword = Request.keyword;		//搜索关键字


var grid_demo_id = "myGrid1" ;

var dsOption= {

	fields :[
		{name : 'MJ'  },{name : 'ZTLX'  },{name : 'GH'  },{name : 'SWH'  },
		{name : 'DH'  },{name : 'WJJS'  },{name : 'AJTM'  },{name : 'QSSJ'  },
		{name : 'ZZSJ'  },{name : 'FLH'  },{name : 'ZTC'  },{name : 'FZ'  }
	//{name : 'MJ'  },{name : 'DH'  },{name : 'AJTM'  },{name : 'WJJS'  }gt_myGrid1_chk_DH
	],
	recordType : 'array'
}
var colsOption = [
     //{id: 'chk' ,isCheckColumn:true, editable:false},
     {id: 'MJ' , header: "MJ" , width:40},
     //{id: 'ZTLX' , header: "类型" , width :40},
     //{id: 'GH' , header: "GH" , width :30 },
     //{id: 'SWH' , header: "SWH" , width :30},
     {id: 'DH' , header: "文件编号" , width :150},     
     {id: 'AJTM' , header: "档案标题" , width :180},
     {id: 'WJJS' , header: "页码" , width :40}
     //{id: 'QSSJ' , header: "QSSJ" , width :40},
     //{id: 'ZZSJ' , header: "ZZSJ" , width :40},
     //{id: 'FLH' , header: "FLH" , width :40},
     //{id: 'ZTC' , header: "ZTC" , width :40},
     //{id: 'FZ' , header: "FZ" , width :40}  
];

function echoMessage(str){
    document.getElementById("event_logs").value += str;
}

var overRowNo = "";
var overColno = "";
var gridOption={
	id : grid_demo_id,
	loadURL : 'Controller.php',
	parameters:{'keyword':<?php echo ("'".$keyword."'"); ?>},
	
	width: "480",  //"100%", // 700,
	height: "390",  //"100%", // 330,
	container : 'gridbox', 
	replaceContainer : true, 
	//listenResize : false,
	selectRowByCheck : true, 
	resizable : true,
	dataset : dsOption ,
	columns : colsOption ,
  pagesize: 15 ,
  pageSizeList : [5,10,15,20],
	toolbarContent : 'nav | goto | pagesize | reload print state',


//单元格单击
onCellClick:function(value, record , cell, row,  colNO, rowNO,columnObj,grid){

	var	file_id_sq="";
  if (colNO ==0){
  	
  	//if (grid.checkedRows[rowNO+(grid.getPageInfo().pageNum-1)*15] == true)
  	//{grid.checkedRows[rowNO+(grid.getPageInfo().pageNum-1)*15] = false}else
  	//{grid.checkedRows[rowNO+(grid.getPageInfo().pageNum-1)*15] = true}
  	
  	for(i=0;i<=15;i++)
  	{
  		if (grid.checkedRows[i+(grid.getPageInfo().pageNum-1)*15] == true)
  		{
  			//alert(i+":"+grid.getCellValue('DH',i));
  			//if (grid.getCellValue('DH',i)!=null) 
  			file_id_sq = file_id_sq + ',' + grid.getCellValue('DH',i);
  			//alert("i="+i+"page:"+grid.getPageInfo().pageNum);
  			
  		}
  	}
  	
 	document.getElementById("file_id_sq").value=file_id_sq;
  //alert (grid.getPageInfo().pageNum);
	}
},
onRowCheck:function(row,chk,grid){
	alert("ff");
	
},

onComplete:function(grid){
  //alert (grid.getPageInfo().pageNum);
  for(i=0;i<=15;i++)
  	{
  	//grid.checkedRows[i+(grid.getPageInfo().pageNum-1)*15] = false;
  		
  	}
},

onHeadClick:function(event,headCell,colObj,grid){
  //echoMessage("onHeadClick called " + headCell.innerText + " ...\n");
  //alert(headCell.childNodes[0].childNodes[0].childNodes[0].nodeValue);
  //alert(headCell.childNodes[0].childNodes[0].childNodes[0].nodeValue);
  file_id_sq = "";
  document.getElementById("file_id_sq").value="jjj";
  	for(i=0;i<=15;i++)
  	{
  		if (grid.checkedRows[i] != true)
  		{
  			//alert(grid.getCellValue('DH',i));
  			if (grid.getCellValue('DH',i)!=null) 
  				file_id_sq=file_id_sq + ',' + grid.getCellValue('DH',i);
  			
  		}
  	}
 	document.getElementById("file_id_sq").value=file_id_sq;
},


onRowClick:function(value, record , cell, row,  colNO, rowNO,columnObj,grid){
  if (colNO >0){
  
  document.getElementById("file_info").src="file_info.php?fileid="+record[4];
  THIS_FILE_ID=record[4];
  //if(document.all.form_jyqq_file_id){document.getElementById("form_jyqq_file_id").value=THIS_FILE_ID;}
  //应选判断此对象是否存在
  if (exist("form_jyqq_file_id")){document.getElementById("form_jyqq_file_id").value=THIS_FILE_ID;}
  if (exist("file_id")){document.getElementById("file_id").value=THIS_FILE_ID;}
  
  
  //var rows = grid.getSelectedRows();
  
  //echoMessage("当前选择的档案编号是:" + record[4] + " ...\n");
  GET_FILE_QX(document.getElementById("jyqq_user_dep").value,THIS_FILE_ID);
  GET_FILE_JYQQ(document.getElementById("jyqq_user_dep").value,THIS_FILE_ID);
  //alert(THIS_FILE_QX);
  
  //setTimeout("set_qx_check(THIS_FILE_QX);document.getElementById(\"file_qx\").value=tree2.getAllChecked();",1000);
	}
}
 
}

var overflag = true;
var mygrid=new Sigma.Grid( gridOption );
Sigma.Util.onLoad( Sigma.Grid.render(mygrid) );

//**********BEGIN授权表单验证**********
function validate_required(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {alert(alerttxt);return false}
  else {return true}
  }
}

//授权表单验证
function validate_form(thisform)
{
with (thisform)
  {
  if (validate_required(file_id,"操作前请先选择一个文件!")==false)
    {return false;}
  if (validate_required(file_qx,"你还没有给任何用户授权!")==false)
    {return false;}
  }
}

//提交借阅请求表单验证
function validate_form_jyqq(thisform)
{
with (thisform)
  {
  if (validate_required(form_jyqq_file_id,"请选定一个档案!")==false)
    {return false;}
  if (validate_required(form_jyqq_reason,"请填写借阅说明!")==false)
    {return false;}
 	if (validate_required(form_jyqq_time,"请填写借阅截止日期!")==false)
    {return false;}
  }
}
function onlyNum()
{

if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)))
//考虑小键盘上的数字键
event.returnvalue=false;
}



//**********END授权表单验证**********
//**********BEGINajax获取此文件的当前权限**********
var xmlHttp
var xmlHttp2

	//获取档案当前权限
	function GET_FILE_QX(file_dep,file_id)
	{ 
			xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null)
				 {
				 alert ("Browser does not support HTTP Request")
				 return
				 }
			var url="ajax_php_get_file_qx.php"
			url=url+"?file_dep="+file_dep
			url=url+"&file_id="+file_id
			
			url=url+"&sid="+Math.random()
			//alert(url);
			xmlHttp.onreadystatechange=stateChanged 
			xmlHttp.open("GET",url,true)
			xmlHttp.send(null)
	}
	
	function stateChanged() 
	{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			 { 
			 //document.getElementById("txtHint").innerHTML=xmlHttp.responseText ;
			 THIS_FILE_QX=xmlHttp.responseText ;
			 set_qx_check(THIS_FILE_QX);document.getElementById("file_qx").value=tree2.getAllChecked();
			 } 
	}
	
	function GetXmlHttpObject()
	{
			var xmlHttp=null;
			try
			 {
			 // Firefox, Opera 8.0+, Safari
			 xmlHttp=new XMLHttpRequest();
			 }
			catch (e)
			 {
			 //Internet Explorer
			 try
			  {
			  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			  }
			 catch (e)
			  {
			  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
	 }
	return xmlHttp;
	}
//**********ENDajax获取此文件的当前权限**********
//**********BEGINajax获取此文件借阅请求情况**********
function GET_FILE_JYQQ(file_dep,file_id)
	{ 
			xmlHttp2=GetXmlHttpObject()
			if (xmlHttp2==null)
				 {
				 alert ("Browser does not support HTTP Request")
				 return
				 }
			//alert(document.getElementById("this_user_type").value);
			var url="ajax_php_get_jyqq.php"
			url=url+"?file_dep="+file_dep
			url=url+"&file_id="+file_id
			url=url+"&usertype="+document.getElementById("this_user_type").value +"&userdep="+document.getElementById("jyqq_user_dep").value
			url=url+"&sid="+Math.random()
			//alert(url);
			xmlHttp2.onreadystatechange=GET_FILE_JYQQ_stateChanged 
			xmlHttp2.open("GET",url,true)
			xmlHttp2.send(null)
	}
	
	function GET_FILE_JYQQ_stateChanged() 
	{ 
			if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
			 { 
			 document.getElementById("jyqq_txtHint").innerHTML=xmlHttp2.responseText ;
			 //THIS_FILE_QX=xmlHttp.responseText ;
			 
			 } 
	}



//**********ENDajax获取此文件借阅情况**********



//**********BEGIN由获取的字符串设置右侧用户权限树形结构**********
//userid:time,
function set_qx_check(str)
{
		
		var str,string;
		var i=0;
		var string=str;
		if ((str=="") || (str == null))
		{
			string="";
		}
		str = string.split(",");
		tree2.setCheck('Root',false);
		while (str[i]!="" && str[i] != null)
		{
			//alert((str[i]).substring(0,str[i].indexOf(":")));
			tree2.setCheck(((str[i]).substring(0,str[i].indexOf(":"))),true); 
			i++;
		}
	
}

//**********END由获取的字符串设置右侧用户权限树形结构**********

</script>
<style type="text/css">
<!--
.style1 {font-size: 24px}
.style2 {font-size: 18px}
.style4 {
	font-size: 24px;
	font-family: "黑体";
	font-weight: bold;
}
-->
</style>
				<link rel="stylesheet" type="text/css" href="dhtml/dhtmlxtree.css">
        <script src="dhtml/dhtmlxcommon.js"></script>
        <script src="dhtml/dhtmlxtree.js"></script>   
</head>
<script>
    tree.setImagePath("dhtml/codebase/imgs/");
      //左侧树形结构单击事件
	  function tonclick(id) {
    		//doLog("Item " + tree.getItemText(id) + " was selected");
    		//alert("dhtml/nudt_"+id+"_ad.xml");
    		tree2.deleteItem('Root',true);
    		tree2.loadXML("dhtml/nudt_"+id+"_ad.xml");
    		document.getElementById("file_dep_qx").value=id;
    		
    		//setTimeout("tree2.setCheck('430001',true);document.getElementById(\"file_qx\").value=tree2.getAllChecked();",1000);
    		setTimeout("set_qx_check(THIS_FILE_QX);document.getElementById(\"file_qx\").value=tree2.getAllChecked();",1000);
    		//alert(id+document.getElementById("file_id").value);
    		//ajax获取此文件的当前权限
    		GET_FILE_QX(id,document.getElementById("file_id").value);
    		
			};
		//右侧树形结构单击事件
		function tonclick_right(id) {
    	//alert(THIS_FILE_QX);
			document.getElementById("file_qx").value=tree2.getAllChecked();
			};

</script>
<body>
			
<div id="page-container">
  <div id="main-nav">
            <div id="logo" style="margin: 10px">
                                        <a href="http://www.mail.nudt.edu.cn">
                                            <img border="0"  src="images/logo.gif"/><span class="style4">档案管理系统</span> </a></div>                                   
					<div id="menu">
            <div class="menuLinkHome">
                <a href="login.php">首页</a></div>
            <div class="menuLink" id="menu1">
                <a href="login.php">浏览档案 </a>
            </div>
            <div class="menuLink" id="menu2">
                <a href="login.php">管理数据</a>
            </div>
            <div class="menuLinkHome">
                <a href="login.php">当前用户：<?php echo($_SESSION["usertype"].":".$_SESSION["userID"]); ?></a>
            </div>
            <div class="menuLinkHome"><a href="login.php"><font color="ff8c00">注销</font></a>
            </div>
          </div>
									
</div>

   
  <div id="header">
  <h1 class="style1">
      浏览档案</h1>
  </div>
<div id="search_bar">
  
</div>

<!--**********--BEGIN首页搜索框--**********-->
<div id="my_div01"><h3>首页搜索框</h3>
	<div id="search_bar">
	<form name="search_form" id="search_form" method="post" action="index.php">
    请输入关键字查询：<input name="keyword" type="keyword" class="style4" id="keyword" /> &nbsp;&nbsp;
    <input type="submit" name="Submit" class="style1" value="搜索" /> 
    高级检索 全部档案<br/>&nbsp;
  	</form>
	</div><br/>
</div><br/>
<!--**********--END首页搜索框--**********-->

<!--**********--BEGIN档案列表及详情--**********-->

  <div id="content">
  <div id="my_div01">
  <div id ="div_gridbox">
	<table width='98%' border="0">
	  <tr>
		<td width='480'>
		<div id="bigbox" style="margin:15px;display:!none;">
      	<div id="gridbox" style="border:0px solid #cccccc;background-color:#f3f3f3;padding:5px;height:200px;width:700px;" ></div>
   	 	</div> 
   	</td>
		<td><iframe id="file_info" name="file_info" width="99%" height="380" src="file_info.php"></iframe><br/></td>
	  </tr>
	</table>

      
  </div>
  
</div> <br/>
<!--**********--END档案列表及详情--**********-->
<!--**********--BEGIN当前档案借阅状态--单位管理员ajax--**********-->
<?php
	if (($_SESSION["usertype"]=="单位保密员")||($_SESSION["usertype"]=="档案管理员"))
	{
?>
<div id="my_div01"><h3>当前档案借阅状态--此模块档案管理员和单位保密员可见</h3>
<div id="jyqq_txtHint" align="center"><b>档案借阅情况</b></div>
</div><br/>

<!--**********--END当前档案借阅状态--单位管理员--**********-->
<!--**********--BEGIN当前等待审核的借阅请求--单位管理员--**********-->
<div id="my_div01"><h3>当前所有等待审核的借阅请求</h3>
	<center>
<?php
//echo $_SESSION["userID"];
if ($_SESSION["usertype"]=="单位保密员")
	{
		$result = DB::query("SELECT * FROM tab_jyqq  LEFT OUTER JOIN testdb ON testdb.DH=tab_jyqq.jyqq_file_id WHERE jyqq_dep='".$_SESSION["userDEP"]."'");
	}
	else if ($_SESSION["usertype"]=="档案管理员")
	{
		$result = DB::query("SELECT * FROM tab_jyqq  LEFT OUTER JOIN testdb ON testdb.DH=tab_jyqq.jyqq_file_id WHERE jyqq_status=1 OR jyqq_status=3 OR jyqq_status=4");
	}

echo "<table style='font-size:12px'  border='1'>
<tr>
<th width='140'>借阅人ID</th>
<th width='140'>借阅档案ID</th>
<th width='200'>借阅档案标题</th>
<th width='200'>借阅说明</th>
<th width='70'>借阅时间</th>
<th width='70'>截止时间</th>
<th width='70'>状态</th>
<th>操作</th>

</tr>";
while($row = DB::fetch($result))
{
 echo "<tr>";
 echo "<td>" . $row['jyqq_user_id'] . "</td>";
 echo "<td>" . $row['jyqq_file_id'] . "</td>";
 echo "<td>" . $row['AJTM'] . "</td>";
 echo "<td>" . $row['jyqq_reason'] . "</td>";
 echo "<td>" . $row['jyqq_time'] . "</td>";
 echo "<td>" . $row['jyqq_time_end'] . "</td>";
 echo "<td>" .$row['jyqq_status']. $JYQQ_STATUS[$row['jyqq_status']] . "</td>";
 
 //echo "<td>" . "<input type=\"button\" onClick=\"javascript:{document.location.href='file_jyqq_s1.php?jyqq_id=".$row['jyqq_id']."&level=2&act=yes';}\" value=\"同意借阅\"><input type=\"button\" value=\"拒绝借阅\">" . "</td>";
 if ($_SESSION["usertype"]=="单位保密员")
	{
		if (($row['jyqq_status']=="0")||($row['jyqq_status']=="1")||($row['jyqq_status']=="2"))
		{
			echo "<td>" . "<input type=\"button\" onClick=\"javascript:{document.location.href='file_jyqq_s1.php?jyqq_id=".$row['jyqq_id']."&step=1&level=1&act=yes';}\" value=\"同意借阅\"><input type=\"button\" onClick=\"javascript:{document.location.href='file_jyqq_s1.php?jyqq_id=".$row['jyqq_id']."&step=1&level=1&act=no';}\" value=\"拒绝借阅\">" . "</td>";
  	}
  	else
		{echo "<td> </td>";}
  }
	else if ($_SESSION["usertype"]=="档案管理员")
	{
		if (($row['jyqq_status']=="1")||($row['jyqq_status']=="3")||($row['jyqq_status']=="4"))
		{
			echo "<td>" . "<input type=\"button\" onClick=\"javascript:{document.location.href='file_jyqq_s1.php?jyqq_id=".$row['jyqq_id']."&step=2&level=2&act=yes';}\" value=\"同意借阅\"><input type=\"button\" onClick=\"javascript:{document.location.href='file_jyqq_s1.php?jyqq_id=".$row['jyqq_id']."&step=2&level=2&act=no';}\" value=\"拒绝借阅\">" . "</td>";
  	}
  	else
		{echo "<td> </td>";}
  }

 echo "</tr>";
}
echo "</table><br/>";
?>
</center>


</div><br/>
<!--**********--END当前等待审核的借阅请求--单位管理员--**********-->
<?php
	}
		if ($_SESSION["usertype"]=="档案管理员")
	{
?>


<!--**********--授权及查看已授权情况--此模块档案管理员可见--**********-->
<div id="my_div01"><h3>授权及查看已授权情况--此模块档案管理员可见</h3>
	<center><form action="file_qx.php" onsubmit="return validate_form(this)" method="post">
	<table>
    <tr>
        <td valign="top" align="left">
            <div id="treeboxbox_tree_1" style="width:250px; height:218px;background-color:#f5f5f5;border :1px solid Silver;"></div>
        </td>
        <td  style="padding-left:25" valign="top" align="left">
        	<div id="treeboxbox_tree_2" style="width:250px; height:218px;background-color:#f5f5f5;border :1px solid Silver;"></div>
        </td>
    </tr>
	<tr><td colspan="2"><div align="center">
	  <input name="file_dep_qx"  type="text" id="file_dep_qx"  /><input name="file_id"  type="text" id="file_id"  />
	  <input name="file_qx" id="file_qx" type="text" /><br/>
	  <input name="file_id_sq" id="file_id_sq" size="80" type="text" />
	  </div></td></tr>
	<tr><td colspan="2"><div align="center">
	  <input name="" type="submit" />
	  </div></td></tr>
	</table>
	</form>
</center>
</div><br/>
<?php
	}
?>
<!--**********--END授权--档案管理员--**********-->

<!--**********--BEGIN提交借阅请求--此模块普通用户可见--**********-->
<?php
	if ($_SESSION["usertype"]=="普通用户")
	{
?>
<div id="my_div01"><h3>提交借阅请求--此模块普通用户可见</h3>
	<form id="form_jyqq" action="file_jyqq.php" onsubmit="return validate_form_jyqq(this)" method="post"><input name="form_jyqq_user_dep" type="text" id="form_jyqq_user_dep" value="xlb" /><input name="form_jyqq_user_id" type="text" id="form_jyqq_user_id" value="<?php echo($_SESSION["userID"]); ?>" />
	<input name="form_jyqq_file_id" id="form_jyqq_file_id" type="text" value="" /><br/>借阅说明：<input name="form_jyqq_reason" type="text" id="form_jyqq_reason" size="70" maxlength="50"  />
	借阅截止日期：<input name="form_jyqq_time" type="text" id="form_jyqq_time" onclick="new Calendar().show(this);" size="10" maxlength="10"/>
	<br/><center><input name="" type="checkbox" value="" checked="checked" >我已阅读档案借阅安全保密须知</input><br/><input  type="submit" value="提交借阅请求" />
	</center></form>
</div><br/>

<!--**********--END提交借阅请求--普通用户--**********-->
<!--**********--BEGIN普通用户已借阅情况--此模块普通用户可见--**********-->
<div id="my_div01"><h3>普通用户已借阅情况--此模块普通用户可见</h3>
<center>
<?php
echo $_SESSION["userID"];
$result = DB::query("SELECT * FROM tab_jyqq  LEFT OUTER JOIN testdb ON testdb.DH=tab_jyqq.jyqq_file_id WHERE jyqq_user_id='".$_SESSION["userID"]."'");
echo "<table style='font-size:12px'  border='1'>
<tr>
<th width='140'>借阅档案ID</th>
<th width='200'>借阅档案标题</th>
<th width='200'>借阅说明</th>
<th width='70'>借阅时间</th>
<th width='70'>截止时间</th>
<th width='70'>状态</th>
<th>操作</th>

</tr>";
while($row = DB::fetch($result))
{
 echo "<tr>";
 echo "<td>" . $row['jyqq_file_id'] . "</td>";
 echo "<td>" . $row['AJTM'] . "</td>";
 echo "<td>" . $row['jyqq_reason'] . "</td>";
 echo "<td>" . $row['jyqq_time'] . "</td>";
 echo "<td>" . $row['jyqq_time_end'] . "</td>";
 echo "<td>" . $JYQQ_STATUS[$row['jyqq_status']] . "</td>";
 if ($row['jyqq_status']==0)	//待审核状态下可以取消
 {echo "<td>" . "<input type=\"button\" onClick=\"javascript:{document.location.href='file_jyqq_qx.php?jyqq_id=".$row['jyqq_id']."';}\" value=\"取消借阅\">" . "</td>";}
 else if ($row['jyqq_status']==3)
 {echo "<td>下载档案</td>";}
 else 
 {echo "<td>请求中...</td>";}
 
 echo "</tr>";
}
echo "</table><br/>";
?>
</center>
</div>  
<?php
	}
?>
<!--**********--END普通用户已借阅情况--此模块普通用户可见--**********-->  
  <h2>Related Links</h2>
  </div>
  <div id="footer">nic-2011</div>
</div>
<!-- JiaThis Button BEGIN 
<script type="text/javascript" src="http://v1.jiathis.com/code/jiathis_r.js?move=0" charset="utf-8"></script>
<!-- JiaThis Button END -->

<!-- Dhtml Tree BEGIN -->
<script> var tree = new dhtmlXTreeObject("treeboxbox_tree_1", "100%", "100%", 0);
tree.setSkin('winstyle');
tree.setImagePath("dhtml/imgs/");
tree.enableCheckBoxes(0);
tree.enableThreeStateCheckboxes(true);
tree.loadXML("dhtml/nudt_root.xml");
tree.setOnClickHandler(tonclick);


tree2 = new dhtmlXTreeObject("treeboxbox_tree_2", "100%", "100%", 0);
tree2.setSkin('winstyle');
tree2.setImagePath("dhtml/imgs/");
tree2.enableCheckBoxes(1);
tree2.enableThreeStateCheckboxes(true);
//tree2.loadXML("dhtml/nudt_xlb_ad.xml");
tree2.setOnCheckHandler(tonclick_right);
tree2.setOnClickHandler(tonclick_right);
</script>
<!-- Dhtml Tree END -->
</body>
</html>